package edu.gdpu.memory.heap;

import com.sun.istack.internal.localization.NullLocalizable;

/**
 * @author mazebin
 * @date 2021年 07月14日 17:35:36
 * 演示堆内存：verbose:gc
 */
public class HeapTest1 {
    public static void main(String[] args) {
        System.out.println("1---");
        try {
            Thread.sleep(3000);
            byte[]  array= new byte[1024*1024*10];
            System.out.println("2---");
            Thread.sleep(2000);
            array = null;
            System.gc();
            System.out.println("3---");
            Thread.sleep(1000);
        } catch ( InterruptedException e ) {
            e.printStackTrace();
        }
    }
}
